//
//  KCHomeHeadView.m
//  Golden
//
//  Created by king on 2017/8/16.
//  Copyright © 2017年 KC. All rights reserved.
//

#import "KCHomeHeadView.h"

@implementation KCHomeHeadView

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = WHITE_COLOR;
    }
    return self;
}

+ (instancetype)headView:(NSString *)title :(NSString *)detailTitle{
    
    KCHomeHeadView *headView = [[KCHomeHeadView alloc]init];

    UILabel *lab = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, 40)];
    lab.text = title;
    lab.font = SYSTEM_FONT(FONTS_14);
    [headView addSubview:lab];
    
    UIView *line = [[UIView alloc]initWithFrame:CGRectMake(0, 39, SCREEN_WIDTH, 1)];
    line.backgroundColor = COLOR_FOR_BG;
    [headView addSubview:line];
    
    if (detailTitle) {
        UILabel *rightLab = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH - 100, 0, 90, 40)];
        rightLab.text = detailTitle;
        rightLab.textColor = COLOR_FOR_RED;
        rightLab.textAlignment = NSTextAlignmentRight;
        rightLab.font = SYSTEM_FONT(FONTS_14);
        [headView addSubview:rightLab];
    }
    
    return headView;
}

@end
